import React from 'react';
import { Form, Input } from 'antd';

interface SummaryInputProps {
    name: string;
    label: string;
    required: boolean;
    onBlur: (value: string) => void;
}

const SummaryInput = (props: SummaryInputProps) => {
    const { name, label, required, onBlur } = props;

    const handleBlur = (e: any) => {
        onBlur(e.target.value)
    };

    return (
        <Form.Item label={label} name={name} required={required} rules={[{ required: required, message: `请输入${label}` }]}>
            <Input onBlur={handleBlur} />
        </Form.Item>
    );
};

export default SummaryInput;